<%@page import="com.zhuoshi.bean.NavigationBean"%>
<%@page import="com.zhuoshi.dao.NavigationDao"%>
<%@page import="com.zhuoshi.bean.ManagerRoleValueBean"%>
<%@page import="com.zhuoshi.bean.ManagerRoleBean"%>
<%@page import="com.zhuoshi.dao.ManagerRoleDao"%>
<%@page import="com.zhuoshi.dao.ManagerDao"%>
<%@page import="com.zhuoshi.bean.ManagerBean"%>
<%@ page language="java" import="java.util.*,com.zhuoshi.utils.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	ManagerBean mBean = (ManagerBean)session.getAttribute("loginBean");//从session中获得登录用户的bean
	if(mBean==null){
		response.sendRedirect("login.jsp");
	}else{
	pageContext.setAttribute("loginBean", mBean);
	ManagerRoleDao roleDao = new ManagerRoleDao();
	//获取角色中文名字
	String roleName = roleDao.getRoleName(mBean.getRole_id());
	pageContext.setAttribute("roleName", roleName);
	//加载菜单
	NavigationDao treeDao = new NavigationDao();
   		List<NavigationBean> nodes = treeDao.getList(0,mBean,mBean.getRole_id());
   		NavigationDao daoTree = new NavigationDao(nodes);
   		String treeMenu = daoTree.buildTree();
   		pageContext.setAttribute("treeMenu", treeMenu);
	}
%>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <link rel="Bookmark" href="http://localhost:8080/favicon.ico">
    <link rel="Shortcut Icon" href="http://localhost:8080/favicon.ico">
    <!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
    <link rel="stylesheet" type="text/css" href="./template/H-ui.min.css">
    <link rel="stylesheet" type="text/css" href="./template/H-ui.admin.css">
    <link rel="stylesheet" type="text/css" href="./template/iconfont.css">
    <link rel="stylesheet" type="text/css" href="./template/icheck.css">
    <link rel="stylesheet" type="text/css" href="./template/skin.css" id="skin">
    <link rel="stylesheet" type="text/css" href="./template/style.css">
    <!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>后台管理系统</title>

    <link rel="stylesheet" href="./template/layer.css" id="layui_layer_skinlayercss">
</head>


<body>
<%-- <c:forEach var="bean" items="${navList }">
${bean.title }(${bean.id }) <br />
</c:forEach> --%>
    <header class="navbar-wrapper">
        <div class="navbar navbar-fixed-top">
            <div class="container-fluid cl">
                <a class="logo navbar-logo f-l mr-10 hidden-xs" href="/MTCms">电网合同管理系统</a>
                <a class="logo navbar-logo-m f-l mr-10 visible-xs" href="http://localhost:8080/aboutHui.shtml">H-ui</a>
                <span class="logo navbar-slogan f-l mr-10 hidden-xs"></span>
                <a aria-hidden="false" class="nav-toggle Hui-iconfont visible-xs" href="javascript:;"></a>

                <nav id="Hui-userbar" class="nav navbar-nav navbar-userbar hidden-xs">
                    <ul class="cl">
                        <li>
                            ${roleName }
                        </li>
                        <li>
                            (${loginBean.realname })
                        </li>
                        <li>
                            <a href="login.jsp">退出</a>
                        </li>


                        <li id="Hui-skin" class="dropDown right dropDown_hover">
                            <a href="javascript:;" class="dropDown_A" title="换肤"><i class="Hui-iconfont" style="font-size: 18px"></i>
						</a>
                            <ul class="dropDown-menu menu radius box-shadow">
                                <li>
                                    <a href="javascript:;" data-val="default" title="默认（黑色）">默认（黑色）</a>
                                </li>
                                <li>
                                    <a href="javascript:;" data-val="blue" title="蓝色">蓝色</a>
                                </li>
                                <li>
                                    <a href="javascript:;" data-val="green" title="绿色">绿色</a>
                                </li>
                                <li>
                                    <a href="javascript:;" data-val="red" title="红色">红色</a>
                                </li>
                                <li>
                                    <a href="javascript:;" data-val="yellow" title="黄色">黄色</a>
                                </li>
                                <li>
                                    <a href="javascript:;" data-val="orange" title="绿色">橙色</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>
    </header>
    <aside class="Hui-aside">
        <input runat="server" id="divScrollValue" type="hidden" value="">
        <div class="menu_dropdown bk_2">
            

            <!-- 菜单加载 -->
            ${treeMenu }
			<!-- /菜单加载 -->

        </div>
    </aside>
    <div class="dislpayArrow hidden-xs">
        <a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a>
    </div>
    <section class="Hui-article-box">
        <div id="Hui-tabNav" class="Hui-tabNav hidden-xs">
            <div class="Hui-tabNav-wp">
                <ul id="min_title_list" class="acrossTab cl" style="width: 133px; left: 0px;">
                    <li class="active">
                        <span title="我的桌面" data-href="welcome.html">我的桌面</span><em></em>
                    </li>
                </ul>
            </div>
            <div class="Hui-tabNav-more btn-group" style="display: none;">
                <a id="js-tabNav-prev" class="btn radius btn-default size-S" href="javascript:;"><i class="Hui-iconfont"></i>
				</a><a id="js-tabNav-next" class="btn radius btn-default size-S" href="javascript:;"><i class="Hui-iconfont"></i>
				</a>
            </div>
        </div>
        <div id="iframe_box" class="Hui-article">
            <div class="show_iframe" style="display: block;">
                <div style="display: none" class="loading"></div>
                <iframe scrolling="yes" frameborder="0" src="./template/welcome.html"></iframe>
            </div>
        </div>
    </section>
    <!--<script src="./template/hm.js"></script>-->
    <script type="text/javascript" src="./template/jquery.min.js"></script>
    <script type="text/javascript" src="./template/layer.js"></script>
    <script type="text/javascript" src="./template/H-ui.js"></script><a href="javascript:void(0)" class="Hui-iconfont toTop" title="返回顶部" alt="返回顶部" style="display:none"></a>
    <script type="text/javascript" src="./template/H-ui.admin.js"></script>
    <script type="text/javascript">
        /*资讯-添加*/
        function article_add(title, url) {
            var index = layer.open({
                type: 2,
                title: title,
                content: url
            });
            layer.full(index);
        }
        /*图片-添加*/
        function picture_add(title, url) {
            var index = layer.open({
                type: 2,
                title: title,
                content: url
            });
            layer.full(index);
        }
        /*产品-添加*/
        function product_add(title, url) {
            var index = layer.open({
                type: 2,
                title: title,
                content: url
            });
            layer.full(index);
        }
        /*用户-添加*/
        function member_add(title, url, w, h) {
            layer_show(title, url, w, h);
        }
    </script>


</body>

</html>